//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS NetworkFlowMonitor service.
///
/// Network Flow Monitor is a feature of Amazon CloudWatch Network Monitoring that provides visibility into the performance of network flows for your Amazon Web Services workloads, between instances in subnets, as well as to and from Amazon Web Services. Lightweight agents that you install on the instances capture performance metrics for your network flows, such as packet loss and latency, and send them to the Network Flow Monitor backend. Then, you can view and analyze metrics from the top contributors for each metric type, to help troubleshoot issues. In addition, when you create a monitor, Network Flow Monitor provides a network health indicator (NHI) that informs you whether there were Amazon Web Services network issues for one or more of the network flows tracked by a monitor, during a time period that you choose. By using this value, you can independently determine if the Amazon Web Services network is impacting your workload during a specific time frame, to help you focus troubleshooting efforts. To learn more about Network Flow Monitor, see the Network Flow Monitor User Guide in the Amazon CloudWatch User Guide.
public struct NetworkFlowMonitor: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the NetworkFlowMonitor client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "NetworkFlowMonitor",
            serviceIdentifier: "networkflowmonitor",
            serviceProtocol: .restjson,
            apiVersion: "2023-04-19",
            endpoint: endpoint,
            errorType: NetworkFlowMonitorErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Create a monitor for specific network flows between local and remote resources, so that you can monitor network performance for one or several of your workloads. For each monitor, Network Flow Monitor publishes detailed end-to-end performance metrics and a network health indicator (NHI) that informs you whether there were Amazon Web Services network issues for one or more of the network flows tracked by a monitor, during a time period that you choose.
    @Sendable
    @inlinable
    public func createMonitor(_ input: CreateMonitorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateMonitorOutput {
        try await self.client.execute(
            operation: "CreateMonitor", 
            path: "/monitors", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a monitor for specific network flows between local and remote resources, so that you can monitor network performance for one or several of your workloads. For each monitor, Network Flow Monitor publishes detailed end-to-end performance metrics and a network health indicator (NHI) that informs you whether there were Amazon Web Services network issues for one or more of the network flows tracked by a monitor, during a time period that you choose.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.
    ///   - localResources: The local resources to monitor. A local resource in a workload is the location of the host, or hosts, where the Network Flow Monitor agent is installed. For example, if a workload consists of an interaction between a web service and a backend database (for example, Amazon Dynamo DB), the subnet with the EC2 instance that hosts the web service, which also runs the agent, is the local resource. Be aware that all local resources must belong to the current Region.
    ///   - monitorName: The name of the monitor.
    ///   - remoteResources: The remote resources to monitor. A remote resource is the other endpoint in the bi-directional flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource. When you specify remote resources, be aware that specific combinations of resources are allowed and others are not, including the following constraints:   All remote resources that you specify must all belong to a single Region.   If you specify Amazon Web Services services as remote resources, any other remote resources that you specify must be in the current Region.   When you specify a remote resource for another Region, you can only specify the Region resource type. You cannot specify a subnet, VPC, or Availability Zone in another Region.   If you leave the RemoteResources parameter empty, the monitor will include all network flows that terminate in the current Region.
    ///   - scopeArn: The Amazon Resource Name (ARN) of the scope for the monitor.
    ///   - tags: The tags for a monitor. You can add a maximum of 200 tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func createMonitor(
        clientToken: String? = CreateMonitorInput.idempotencyToken(),
        localResources: [MonitorLocalResource],
        monitorName: String,
        remoteResources: [MonitorRemoteResource]? = nil,
        scopeArn: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateMonitorOutput {
        let input = CreateMonitorInput(
            clientToken: clientToken, 
            localResources: localResources, 
            monitorName: monitorName, 
            remoteResources: remoteResources, 
            scopeArn: scopeArn, 
            tags: tags
        )
        return try await self.createMonitor(input, logger: logger)
    }

    /// In Network Flow Monitor, you specify a scope for the service to generate metrics for. By using the scope, Network Flow Monitor can generate a topology of all the resources to measure performance metrics for. When you create a scope, you enable permissions for Network Flow Monitor. A scope is a Region-account pair or multiple Region-account pairs. Network Flow Monitor uses your scope to determine all the resources (the topology) where Network Flow Monitor will gather network flow performance metrics for you. To provide performance metrics, Network Flow Monitor uses the data that is sent by the Network Flow Monitor agents you install on the resources. To define the Region-account pairs for your scope, the Network Flow Monitor API uses the following constucts, which allow for future flexibility in defining scopes:    Targets, which are arrays of targetResources.    Target resources, which are Region-targetIdentifier pairs.    Target identifiers, made up of a targetID (currently always an account ID) and a targetType (currently always an account).
    @Sendable
    @inlinable
    public func createScope(_ input: CreateScopeInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateScopeOutput {
        try await self.client.execute(
            operation: "CreateScope", 
            path: "/scopes", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// In Network Flow Monitor, you specify a scope for the service to generate metrics for. By using the scope, Network Flow Monitor can generate a topology of all the resources to measure performance metrics for. When you create a scope, you enable permissions for Network Flow Monitor. A scope is a Region-account pair or multiple Region-account pairs. Network Flow Monitor uses your scope to determine all the resources (the topology) where Network Flow Monitor will gather network flow performance metrics for you. To provide performance metrics, Network Flow Monitor uses the data that is sent by the Network Flow Monitor agents you install on the resources. To define the Region-account pairs for your scope, the Network Flow Monitor API uses the following constucts, which allow for future flexibility in defining scopes:    Targets, which are arrays of targetResources.    Target resources, which are Region-targetIdentifier pairs.    Target identifiers, made up of a targetID (currently always an account ID) and a targetType (currently always an account).
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.
    ///   - tags: The tags for a scope. You can add a maximum of 200 tags.
    ///   - targets: The targets to define the scope to be monitored. A target is an array of targetResources, which are currently Region-account pairs, defined by targetResource constructs.
    ///   - logger: Logger use during operation
    @inlinable
    public func createScope(
        clientToken: String? = CreateScopeInput.idempotencyToken(),
        tags: [String: String]? = nil,
        targets: [TargetResource],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateScopeOutput {
        let input = CreateScopeInput(
            clientToken: clientToken, 
            tags: tags, 
            targets: targets
        )
        return try await self.createScope(input, logger: logger)
    }

    /// Deletes a monitor in Network Flow Monitor.
    @Sendable
    @inlinable
    public func deleteMonitor(_ input: DeleteMonitorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteMonitorOutput {
        try await self.client.execute(
            operation: "DeleteMonitor", 
            path: "/monitors/{monitorName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a monitor in Network Flow Monitor.
    ///
    /// Parameters:
    ///   - monitorName: The name of the monitor to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteMonitor(
        monitorName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteMonitorOutput {
        let input = DeleteMonitorInput(
            monitorName: monitorName
        )
        return try await self.deleteMonitor(input, logger: logger)
    }

    /// Deletes a scope that has been defined.
    @Sendable
    @inlinable
    public func deleteScope(_ input: DeleteScopeInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteScopeOutput {
        try await self.client.execute(
            operation: "DeleteScope", 
            path: "/scopes/{scopeId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a scope that has been defined.
    ///
    /// Parameters:
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteScope(
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteScopeOutput {
        let input = DeleteScopeInput(
            scopeId: scopeId
        )
        return try await self.deleteScope(input, logger: logger)
    }

    /// Gets information about a monitor in Network Flow Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.
    @Sendable
    @inlinable
    public func getMonitor(_ input: GetMonitorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetMonitorOutput {
        try await self.client.execute(
            operation: "GetMonitor", 
            path: "/monitors/{monitorName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about a monitor in Network Flow Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.
    ///
    /// Parameters:
    ///   - monitorName: The name of the monitor.
    ///   - logger: Logger use during operation
    @inlinable
    public func getMonitor(
        monitorName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetMonitorOutput {
        let input = GetMonitorInput(
            monitorName: monitorName
        )
        return try await self.getMonitor(input, logger: logger)
    }

    /// Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a specific monitor. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryMonitorTopContributors. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func getQueryResultsMonitorTopContributors(_ input: GetQueryResultsMonitorTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryResultsMonitorTopContributorsOutput {
        try await self.client.execute(
            operation: "GetQueryResultsMonitorTopContributors", 
            path: "/monitors/{monitorName}/topContributorsQueries/{queryId}/results", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a specific monitor. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryMonitorTopContributors. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - monitorName: The name of the monitor.
    ///   - nextToken: The token for the next set of results. You receive this token from a previous call.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryResultsMonitorTopContributors(
        maxResults: Int? = nil,
        monitorName: String,
        nextToken: String? = nil,
        queryId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryResultsMonitorTopContributorsOutput {
        let input = GetQueryResultsMonitorTopContributorsInput(
            maxResults: maxResults, 
            monitorName: monitorName, 
            nextToken: nextToken, 
            queryId: queryId
        )
        return try await self.getQueryResultsMonitorTopContributors(input, logger: logger)
    }

    /// Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a scope for workload insights. Workload insights provide a high level view of network flow performance data collected by agents. To return the data for the top contributors, see GetQueryResultsWorkloadInsightsTopContributorsData. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributors. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributors(_ input: GetQueryResultsWorkloadInsightsTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryResultsWorkloadInsightsTopContributorsOutput {
        try await self.client.execute(
            operation: "GetQueryResultsWorkloadInsightsTopContributors", 
            path: "/workloadInsights/{scopeId}/topContributorsQueries/{queryId}/results", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Return the data for a query with the Network Flow Monitor query interface. You specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for a scope for workload insights. Workload insights provide a high level view of network flow performance data collected by agents. To return the data for the top contributors, see GetQueryResultsWorkloadInsightsTopContributorsData. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributors. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - nextToken: The token for the next set of results. You receive this token from a previous call.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributors(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryResultsWorkloadInsightsTopContributorsOutput {
        let input = GetQueryResultsWorkloadInsightsTopContributorsInput(
            maxResults: maxResults, 
            nextToken: nextToken, 
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.getQueryResultsWorkloadInsightsTopContributors(input, logger: logger)
    }

    /// Return the data for a query with the Network Flow Monitor query interface. Specify the query that you want to return results for by providing a query ID and a scope ID. This query returns the data for top contributors for workload insights for a specific scope. Workload insights provide a high level view of network flow performance data collected by agents for a scope. To return just the top contributors, see GetQueryResultsWorkloadInsightsTopContributors. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributorsData. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned. The top contributor network flows overall are for a specific metric type, for example, the number of retransmissions.
    @Sendable
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsData(_ input: GetQueryResultsWorkloadInsightsTopContributorsDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryResultsWorkloadInsightsTopContributorsDataOutput {
        try await self.client.execute(
            operation: "GetQueryResultsWorkloadInsightsTopContributorsData", 
            path: "/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}/results", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Return the data for a query with the Network Flow Monitor query interface. Specify the query that you want to return results for by providing a query ID and a scope ID. This query returns the data for top contributors for workload insights for a specific scope. Workload insights provide a high level view of network flow performance data collected by agents for a scope. To return just the top contributors, see GetQueryResultsWorkloadInsightsTopContributors. Create a query ID for this call by calling the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributorsData. Use the scope ID that was returned for your account by CreateScope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned. The top contributor network flows overall are for a specific metric type, for example, the number of retransmissions.
    ///
    /// Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - nextToken: The token for the next set of results. You receive this token from a previous call.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsData(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryResultsWorkloadInsightsTopContributorsDataOutput {
        let input = GetQueryResultsWorkloadInsightsTopContributorsDataInput(
            maxResults: maxResults, 
            nextToken: nextToken, 
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.getQueryResultsWorkloadInsightsTopContributorsData(input, logger: logger)
    }

    /// Returns the current status of a query for the Network Flow Monitor query interface, for a specified query ID and monitor. This call returns the query status for the top contributors for a monitor. When you create a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start (create) the query, StartQueryMonitorTopContributors. When you run a query, use this call to check the status of the query to make sure that the query has SUCCEEDED before you review the results.
    @Sendable
    @inlinable
    public func getQueryStatusMonitorTopContributors(_ input: GetQueryStatusMonitorTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryStatusMonitorTopContributorsOutput {
        try await self.client.execute(
            operation: "GetQueryStatusMonitorTopContributors", 
            path: "/monitors/{monitorName}/topContributorsQueries/{queryId}/status", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the current status of a query for the Network Flow Monitor query interface, for a specified query ID and monitor. This call returns the query status for the top contributors for a monitor. When you create a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start (create) the query, StartQueryMonitorTopContributors. When you run a query, use this call to check the status of the query to make sure that the query has SUCCEEDED before you review the results.
    ///
    /// Parameters:
    ///   - monitorName: The name of the monitor.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to start a query.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryStatusMonitorTopContributors(
        monitorName: String,
        queryId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryStatusMonitorTopContributorsOutput {
        let input = GetQueryStatusMonitorTopContributorsInput(
            monitorName: monitorName, 
            queryId: queryId
        )
        return try await self.getQueryStatusMonitorTopContributors(input, logger: logger)
    }

    /// Return the data for a query with the Network Flow Monitor query interface. Specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for workload insights. When you start a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributors. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func getQueryStatusWorkloadInsightsTopContributors(_ input: GetQueryStatusWorkloadInsightsTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryStatusWorkloadInsightsTopContributorsOutput {
        try await self.client.execute(
            operation: "GetQueryStatusWorkloadInsightsTopContributors", 
            path: "/workloadInsights/{scopeId}/topContributorsQueries/{queryId}/status", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Return the data for a query with the Network Flow Monitor query interface. Specify the query that you want to return results for by providing a query ID and a monitor name. This query returns the top contributors for workload insights. When you start a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributors. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to start a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryStatusWorkloadInsightsTopContributors(
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryStatusWorkloadInsightsTopContributorsOutput {
        let input = GetQueryStatusWorkloadInsightsTopContributorsInput(
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.getQueryStatusWorkloadInsightsTopContributors(input, logger: logger)
    }

    /// Returns the current status of a query for the Network Flow Monitor query interface, for a specified query ID and monitor. This call returns the query status for the top contributors data for workload insights. When you start a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributorsData. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned. The top contributor network flows overall are for a specific metric type, for example, the number of retransmissions.
    @Sendable
    @inlinable
    public func getQueryStatusWorkloadInsightsTopContributorsData(_ input: GetQueryStatusWorkloadInsightsTopContributorsDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetQueryStatusWorkloadInsightsTopContributorsDataOutput {
        try await self.client.execute(
            operation: "GetQueryStatusWorkloadInsightsTopContributorsData", 
            path: "/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}/status", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the current status of a query for the Network Flow Monitor query interface, for a specified query ID and monitor. This call returns the query status for the top contributors data for workload insights. When you start a query, use this call to check the status of the query to make sure that it has has SUCCEEDED before you review the results. Use the same query ID that you used for the corresponding API call to start the query, StartQueryWorkloadInsightsTopContributorsData. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned. The top contributor network flows overall are for a specific metric type, for example, the number of retransmissions.
    ///
    /// Parameters:
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to start a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account. A scope ID is returned from a CreateScope API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func getQueryStatusWorkloadInsightsTopContributorsData(
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetQueryStatusWorkloadInsightsTopContributorsDataOutput {
        let input = GetQueryStatusWorkloadInsightsTopContributorsDataInput(
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.getQueryStatusWorkloadInsightsTopContributorsData(input, logger: logger)
    }

    /// Gets information about a scope, including the name, status, tags, and target details. The scope in Network Flow Monitor is an account.
    @Sendable
    @inlinable
    public func getScope(_ input: GetScopeInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetScopeOutput {
        try await self.client.execute(
            operation: "GetScope", 
            path: "/scopes/{scopeId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about a scope, including the name, status, tags, and target details. The scope in Network Flow Monitor is an account.
    ///
    /// Parameters:
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account. A scope ID is returned from a CreateScope API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func getScope(
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetScopeOutput {
        let input = GetScopeInput(
            scopeId: scopeId
        )
        return try await self.getScope(input, logger: logger)
    }

    /// List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the STATUS parameter.
    @Sendable
    @inlinable
    public func listMonitors(_ input: ListMonitorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListMonitorsOutput {
        try await self.client.execute(
            operation: "ListMonitors", 
            path: "/monitors", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List all monitors in an account. Optionally, you can list only monitors that have a specific status, by using the STATUS parameter.
    ///
    /// Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - monitorStatus: The status of a monitor. The status can be one of the following    PENDING: The monitor is in the process of being created.    ACTIVE: The monitor is active.    INACTIVE: The monitor is inactive.    ERROR: Monitor creation failed due to an error.    DELETING: The monitor is in the process of being deleted.
    ///   - nextToken: The token for the next set of results. You receive this token from a previous call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listMonitors(
        maxResults: Int? = nil,
        monitorStatus: MonitorStatus? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListMonitorsOutput {
        let input = ListMonitorsInput(
            maxResults: maxResults, 
            monitorStatus: monitorStatus, 
            nextToken: nextToken
        )
        return try await self.listMonitors(input, logger: logger)
    }

    /// List all the scopes for an account.
    @Sendable
    @inlinable
    public func listScopes(_ input: ListScopesInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListScopesOutput {
        try await self.client.execute(
            operation: "ListScopes", 
            path: "/scopes", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List all the scopes for an account.
    ///
    /// Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - nextToken: The token for the next set of results. You receive this token from a previous call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listScopes(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListScopesOutput {
        let input = ListScopesInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listScopes(input, logger: logger)
    }

    /// Returns all the tags for a resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns all the tags for a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Create a query that you can use with the Network Flow Monitor query interface to return the top contributors for a monitor. Specify the monitor that you want to create the query for.  The call returns a query ID that you can use with  GetQueryResultsMonitorTopContributors to run the query and return the top contributors for a specific monitor. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func startQueryMonitorTopContributors(_ input: StartQueryMonitorTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StartQueryMonitorTopContributorsOutput {
        try await self.client.execute(
            operation: "StartQueryMonitorTopContributors", 
            path: "/monitors/{monitorName}/topContributorsQueries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a query that you can use with the Network Flow Monitor query interface to return the top contributors for a monitor. Specify the monitor that you want to create the query for.  The call returns a query ID that you can use with  GetQueryResultsMonitorTopContributors to run the query and return the top contributors for a specific monitor. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - destinationCategory: The category that you want to query top contributors for, for a specific monitor. Destination categories can be one of the following:     INTRA_AZ: Top contributor network flows within a single Availability Zone    INTER_AZ: Top contributor network flows between Availability Zones    INTER_REGION: Top contributor network flows between Regions (to the edge of another Region)    INTER_VPC: Top contributor network flows between VPCs    AMAZON_S3: Top contributor network flows to or from Amazon S3    AMAZON_DYNAMODB: Top contributor network flows to or from Amazon Dynamo DB    UNCLASSIFIED: Top contributor network flows that do not have a bucket classification
    ///   - endTime: The timestamp that is the date and time end of the period that you want to retrieve results for with your query.
    ///   - limit: The maximum number of top contributors to return.
    ///   - metricName: The metric that you want to query top contributors for. That is, you can specify a metric with this call and return the top contributor network flows, for that type of metric, for a monitor and (optionally) within a specific category, such as network flows between Availability Zones.
    ///   - monitorName: The name of the monitor.
    ///   - startTime: The timestamp that is the date and time that is the beginning of the period that you want to retrieve results for with your query.
    ///   - logger: Logger use during operation
    @inlinable
    public func startQueryMonitorTopContributors(
        destinationCategory: DestinationCategory,
        endTime: Date,
        limit: Int? = nil,
        metricName: MonitorMetric,
        monitorName: String,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartQueryMonitorTopContributorsOutput {
        let input = StartQueryMonitorTopContributorsInput(
            destinationCategory: destinationCategory, 
            endTime: endTime, 
            limit: limit, 
            metricName: metricName, 
            monitorName: monitorName, 
            startTime: startTime
        )
        return try await self.startQueryMonitorTopContributors(input, logger: logger)
    }

    /// Create a query with the Network Flow Monitor query interface that you can run to return workload insights top contributors. Specify the scope that you want to create a query for. The call returns a query ID that you can use with  GetQueryResultsWorkloadInsightsTopContributors to run the query and return the top contributors for the workload insights for a scope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func startQueryWorkloadInsightsTopContributors(_ input: StartQueryWorkloadInsightsTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StartQueryWorkloadInsightsTopContributorsOutput {
        try await self.client.execute(
            operation: "StartQueryWorkloadInsightsTopContributors", 
            path: "/workloadInsights/{scopeId}/topContributorsQueries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a query with the Network Flow Monitor query interface that you can run to return workload insights top contributors. Specify the scope that you want to create a query for. The call returns a query ID that you can use with  GetQueryResultsWorkloadInsightsTopContributors to run the query and return the top contributors for the workload insights for a scope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable APIs for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - destinationCategory: The destination category for a top contributors row. Destination categories can be one of the following:     INTRA_AZ: Top contributor network flows within a single Availability Zone    INTER_AZ: Top contributor network flows between Availability Zones    INTER_REGION: Top contributor network flows between Regions (to the edge of another Region)    INTER_VPC: Top contributor network flows between VPCs    AWS_SERVICES: Top contributor network flows to or from Amazon Web Services services    UNCLASSIFIED: Top contributor network flows that do not have a bucket classification
    ///   - endTime: The timestamp that is the date and time end of the period that you want to retrieve results for with your query.
    ///   - limit: The maximum number of top contributors to return.
    ///   - metricName: The metric that you want to query top contributors for. That is, you can specify this metric to return the top contributor network flows, for this type of metric, for a monitor and (optionally) within a specific category, such as network flows between Availability Zones.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account. A scope ID is returned from a CreateScope API call.
    ///   - startTime: The timestamp that is the date and time that is the beginning of the period that you want to retrieve results for with your query.
    ///   - logger: Logger use during operation
    @inlinable
    public func startQueryWorkloadInsightsTopContributors(
        destinationCategory: DestinationCategory,
        endTime: Date,
        limit: Int? = nil,
        metricName: WorkloadInsightsMetric,
        scopeId: String,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartQueryWorkloadInsightsTopContributorsOutput {
        let input = StartQueryWorkloadInsightsTopContributorsInput(
            destinationCategory: destinationCategory, 
            endTime: endTime, 
            limit: limit, 
            metricName: metricName, 
            scopeId: scopeId, 
            startTime: startTime
        )
        return try await self.startQueryWorkloadInsightsTopContributors(input, logger: logger)
    }

    /// Create a query with the Network Flow Monitor query interface that you can run to return data for workload insights top contributors. Specify the scope that you want to create a query for. The call returns a query ID that you can use with  GetQueryResultsWorkloadInsightsTopContributorsData to run the query and return the data for the top contributors for the workload insights for a scope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func startQueryWorkloadInsightsTopContributorsData(_ input: StartQueryWorkloadInsightsTopContributorsDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StartQueryWorkloadInsightsTopContributorsDataOutput {
        try await self.client.execute(
            operation: "StartQueryWorkloadInsightsTopContributorsData", 
            path: "/workloadInsights/{scopeId}/topContributorsDataQueries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a query with the Network Flow Monitor query interface that you can run to return data for workload insights top contributors. Specify the scope that you want to create a query for. The call returns a query ID that you can use with  GetQueryResultsWorkloadInsightsTopContributorsData to run the query and return the data for the top contributors for the workload insights for a scope. Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - destinationCategory: The destination category for a top contributors. Destination categories can be one of the following:     INTRA_AZ: Top contributor network flows within a single Availability Zone    INTER_AZ: Top contributor network flows between Availability Zones    INTER_REGION: Top contributor network flows between Regions (to the edge of another Region)    INTER_VPC: Top contributor network flows between VPCs    AWS_SERVICES: Top contributor network flows to or from Amazon Web Services services    UNCLASSIFIED: Top contributor network flows that do not have a bucket classification
    ///   - endTime: The timestamp that is the date and time end of the period that you want to retrieve results for with your query.
    ///   - metricName: The metric that you want to query top contributors for. That is, you can specify this metric to return the top contributor network flows, for this type of metric, for a monitor and (optionally) within a specific category, such as network flows between Availability Zones.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - startTime: The timestamp that is the date and time that is the beginning of the period that you want to retrieve results for with your query.
    ///   - logger: Logger use during operation
    @inlinable
    public func startQueryWorkloadInsightsTopContributorsData(
        destinationCategory: DestinationCategory,
        endTime: Date,
        metricName: WorkloadInsightsMetric,
        scopeId: String,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartQueryWorkloadInsightsTopContributorsDataOutput {
        let input = StartQueryWorkloadInsightsTopContributorsDataInput(
            destinationCategory: destinationCategory, 
            endTime: endTime, 
            metricName: metricName, 
            scopeId: scopeId, 
            startTime: startTime
        )
        return try await self.startQueryWorkloadInsightsTopContributorsData(input, logger: logger)
    }

    /// Stop a top contributors query for a monitor. Specify the query that you want to stop by providing a query ID and a monitor name.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func stopQueryMonitorTopContributors(_ input: StopQueryMonitorTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StopQueryMonitorTopContributorsOutput {
        try await self.client.execute(
            operation: "StopQueryMonitorTopContributors", 
            path: "/monitors/{monitorName}/topContributorsQueries/{queryId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stop a top contributors query for a monitor. Specify the query that you want to stop by providing a query ID and a monitor name.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - monitorName: The name of the monitor.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopQueryMonitorTopContributors(
        monitorName: String,
        queryId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopQueryMonitorTopContributorsOutput {
        let input = StopQueryMonitorTopContributorsInput(
            monitorName: monitorName, 
            queryId: queryId
        )
        return try await self.stopQueryMonitorTopContributors(input, logger: logger)
    }

    /// Stop a top contributors query for workload insights. Specify the query that you want to stop by providing a query ID and a scope ID.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func stopQueryWorkloadInsightsTopContributors(_ input: StopQueryWorkloadInsightsTopContributorsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StopQueryWorkloadInsightsTopContributorsOutput {
        try await self.client.execute(
            operation: "StopQueryWorkloadInsightsTopContributors", 
            path: "/workloadInsights/{scopeId}/topContributorsQueries/{queryId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stop a top contributors query for workload insights. Specify the query that you want to stop by providing a query ID and a scope ID.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopQueryWorkloadInsightsTopContributors(
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopQueryWorkloadInsightsTopContributorsOutput {
        let input = StopQueryWorkloadInsightsTopContributorsInput(
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.stopQueryWorkloadInsightsTopContributors(input, logger: logger)
    }

    /// Stop a top contributors data query for workload insights. Specify the query that you want to stop by providing a query ID and a scope ID.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    @Sendable
    @inlinable
    public func stopQueryWorkloadInsightsTopContributorsData(_ input: StopQueryWorkloadInsightsTopContributorsDataInput, logger: Logger = AWSClient.loggingDisabled) async throws -> StopQueryWorkloadInsightsTopContributorsDataOutput {
        try await self.client.execute(
            operation: "StopQueryWorkloadInsightsTopContributorsData", 
            path: "/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stop a top contributors data query for workload insights. Specify the query that you want to stop by providing a query ID and a scope ID.  Top contributors in Network Flow Monitor are network flows with the highest values for a specific metric type. Top contributors can be across all workload insights, for a given scope, or for a specific monitor. Use the applicable call for the top contributors that you want to be returned.
    ///
    /// Parameters:
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopQueryWorkloadInsightsTopContributorsData(
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopQueryWorkloadInsightsTopContributorsDataOutput {
        let input = StopQueryWorkloadInsightsTopContributorsDataInput(
            queryId: queryId, 
            scopeId: scopeId
        )
        return try await self.stopQueryWorkloadInsightsTopContributorsData(input, logger: logger)
    }

    /// Adds a tag to a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds a tag to a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tags: The tags for a resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes a tag from a resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a tag from a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tagKeys: Keys that you specified when you tagged a resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Update a monitor to add or remove local or remote resources.
    @Sendable
    @inlinable
    public func updateMonitor(_ input: UpdateMonitorInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateMonitorOutput {
        try await self.client.execute(
            operation: "UpdateMonitor", 
            path: "/monitors/{monitorName}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update a monitor to add or remove local or remote resources.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.
    ///   - localResourcesToAdd: Additional local resources to specify network flows for a monitor, as an array of resources with identifiers and types. A local resource in a workload is the location of hosts where the Network Flow Monitor agent is installed.
    ///   - localResourcesToRemove: The local resources to remove, as an array of resources with identifiers and types.
    ///   - monitorName: The name of the monitor.
    ///   - remoteResourcesToAdd: The remote resources to add, as an array of resources with identifiers and types. A remote resource is the other endpoint in the flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.
    ///   - remoteResourcesToRemove: The remote resources to remove, as an array of resources with identifiers and types. A remote resource is the other endpoint specified for the network flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateMonitor(
        clientToken: String? = UpdateMonitorInput.idempotencyToken(),
        localResourcesToAdd: [MonitorLocalResource]? = nil,
        localResourcesToRemove: [MonitorLocalResource]? = nil,
        monitorName: String,
        remoteResourcesToAdd: [MonitorRemoteResource]? = nil,
        remoteResourcesToRemove: [MonitorRemoteResource]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateMonitorOutput {
        let input = UpdateMonitorInput(
            clientToken: clientToken, 
            localResourcesToAdd: localResourcesToAdd, 
            localResourcesToRemove: localResourcesToRemove, 
            monitorName: monitorName, 
            remoteResourcesToAdd: remoteResourcesToAdd, 
            remoteResourcesToRemove: remoteResourcesToRemove
        )
        return try await self.updateMonitor(input, logger: logger)
    }

    /// Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.
    @Sendable
    @inlinable
    public func updateScope(_ input: UpdateScopeInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateScopeOutput {
        try await self.client.execute(
            operation: "UpdateScope", 
            path: "/scopes/{scopeId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.
    ///
    /// Parameters:
    ///   - resourcesToAdd: A list of resources to add to a scope.
    ///   - resourcesToDelete: A list of resources to delete from a scope.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateScope(
        resourcesToAdd: [TargetResource]? = nil,
        resourcesToDelete: [TargetResource]? = nil,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateScopeOutput {
        let input = UpdateScopeInput(
            resourcesToAdd: resourcesToAdd, 
            resourcesToDelete: resourcesToDelete, 
            scopeId: scopeId
        )
        return try await self.updateScope(input, logger: logger)
    }
}

extension NetworkFlowMonitor {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: NetworkFlowMonitor, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension NetworkFlowMonitor {
    /// Return PaginatorSequence for operation ``getQueryResultsMonitorTopContributors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsMonitorTopContributorsPaginator(
        _ input: GetQueryResultsMonitorTopContributorsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetQueryResultsMonitorTopContributorsInput, GetQueryResultsMonitorTopContributorsOutput> {
        return .init(
            input: input,
            command: self.getQueryResultsMonitorTopContributors,
            inputKey: \GetQueryResultsMonitorTopContributorsInput.nextToken,
            outputKey: \GetQueryResultsMonitorTopContributorsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getQueryResultsMonitorTopContributors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - monitorName: The name of the monitor.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsMonitorTopContributorsPaginator(
        maxResults: Int? = nil,
        monitorName: String,
        queryId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetQueryResultsMonitorTopContributorsInput, GetQueryResultsMonitorTopContributorsOutput> {
        let input = GetQueryResultsMonitorTopContributorsInput(
            maxResults: maxResults, 
            monitorName: monitorName, 
            queryId: queryId
        )
        return self.getQueryResultsMonitorTopContributorsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getQueryResultsWorkloadInsightsTopContributors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsPaginator(
        _ input: GetQueryResultsWorkloadInsightsTopContributorsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetQueryResultsWorkloadInsightsTopContributorsInput, GetQueryResultsWorkloadInsightsTopContributorsOutput> {
        return .init(
            input: input,
            command: self.getQueryResultsWorkloadInsightsTopContributors,
            inputKey: \GetQueryResultsWorkloadInsightsTopContributorsInput.nextToken,
            outputKey: \GetQueryResultsWorkloadInsightsTopContributorsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getQueryResultsWorkloadInsightsTopContributors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsPaginator(
        maxResults: Int? = nil,
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetQueryResultsWorkloadInsightsTopContributorsInput, GetQueryResultsWorkloadInsightsTopContributorsOutput> {
        let input = GetQueryResultsWorkloadInsightsTopContributorsInput(
            maxResults: maxResults, 
            queryId: queryId, 
            scopeId: scopeId
        )
        return self.getQueryResultsWorkloadInsightsTopContributorsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getQueryResultsWorkloadInsightsTopContributorsData(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsDataPaginator(
        _ input: GetQueryResultsWorkloadInsightsTopContributorsDataInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetQueryResultsWorkloadInsightsTopContributorsDataInput, GetQueryResultsWorkloadInsightsTopContributorsDataOutput> {
        return .init(
            input: input,
            command: self.getQueryResultsWorkloadInsightsTopContributorsData,
            inputKey: \GetQueryResultsWorkloadInsightsTopContributorsDataInput.nextToken,
            outputKey: \GetQueryResultsWorkloadInsightsTopContributorsDataOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getQueryResultsWorkloadInsightsTopContributorsData(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - queryId: The identifier for the query. A query ID is an internally-generated identifier for a specific query returned from an API call to create a query.
    ///   - scopeId: The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.
    ///   - logger: Logger used for logging
    @inlinable
    public func getQueryResultsWorkloadInsightsTopContributorsDataPaginator(
        maxResults: Int? = nil,
        queryId: String,
        scopeId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetQueryResultsWorkloadInsightsTopContributorsDataInput, GetQueryResultsWorkloadInsightsTopContributorsDataOutput> {
        let input = GetQueryResultsWorkloadInsightsTopContributorsDataInput(
            maxResults: maxResults, 
            queryId: queryId, 
            scopeId: scopeId
        )
        return self.getQueryResultsWorkloadInsightsTopContributorsDataPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listMonitors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listMonitorsPaginator(
        _ input: ListMonitorsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListMonitorsInput, ListMonitorsOutput> {
        return .init(
            input: input,
            command: self.listMonitors,
            inputKey: \ListMonitorsInput.nextToken,
            outputKey: \ListMonitorsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listMonitors(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - monitorStatus: The status of a monitor. The status can be one of the following    PENDING: The monitor is in the process of being created.    ACTIVE: The monitor is active.    INACTIVE: The monitor is inactive.    ERROR: Monitor creation failed due to an error.    DELETING: The monitor is in the process of being deleted.
    ///   - logger: Logger used for logging
    @inlinable
    public func listMonitorsPaginator(
        maxResults: Int? = nil,
        monitorStatus: MonitorStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListMonitorsInput, ListMonitorsOutput> {
        let input = ListMonitorsInput(
            maxResults: maxResults, 
            monitorStatus: monitorStatus
        )
        return self.listMonitorsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listScopes(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listScopesPaginator(
        _ input: ListScopesInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListScopesInput, ListScopesOutput> {
        return .init(
            input: input,
            command: self.listScopes,
            inputKey: \ListScopesInput.nextToken,
            outputKey: \ListScopesOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listScopes(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of query results that you want to return with this call.
    ///   - logger: Logger used for logging
    @inlinable
    public func listScopesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListScopesInput, ListScopesOutput> {
        let input = ListScopesInput(
            maxResults: maxResults
        )
        return self.listScopesPaginator(input, logger: logger)
    }
}

extension NetworkFlowMonitor.GetQueryResultsMonitorTopContributorsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> NetworkFlowMonitor.GetQueryResultsMonitorTopContributorsInput {
        return .init(
            maxResults: self.maxResults,
            monitorName: self.monitorName,
            nextToken: token,
            queryId: self.queryId
        )
    }
}

extension NetworkFlowMonitor.GetQueryResultsWorkloadInsightsTopContributorsDataInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> NetworkFlowMonitor.GetQueryResultsWorkloadInsightsTopContributorsDataInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            queryId: self.queryId,
            scopeId: self.scopeId
        )
    }
}

extension NetworkFlowMonitor.GetQueryResultsWorkloadInsightsTopContributorsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> NetworkFlowMonitor.GetQueryResultsWorkloadInsightsTopContributorsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            queryId: self.queryId,
            scopeId: self.scopeId
        )
    }
}

extension NetworkFlowMonitor.ListMonitorsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> NetworkFlowMonitor.ListMonitorsInput {
        return .init(
            maxResults: self.maxResults,
            monitorStatus: self.monitorStatus,
            nextToken: token
        )
    }
}

extension NetworkFlowMonitor.ListScopesInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> NetworkFlowMonitor.ListScopesInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
